﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="aspZone.Commerce.Web.App.Views.Cart.Index" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="BreadCrumbs">
<%= Html.ActionLink("Home", "Index", "Home") %> &gt; Cart
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Cart</h1>
    <table border="0">
    <tr>
        <td></td>
        <td>Quantity</td>
        <td>Product</td>
        <td>Price</td>
        <td>SubTotal</td>
        <td></td>
    </tr>
    <% using (Html.BeginForm<CartController>(x => x.Update(), FormMethod.Post))
       { %>
    <% foreach (var item in ViewData.Model.Items)
       { %>
       <tr>
        <td><a href="<%= Html.BuildUrlFromExpression<CatalogController>(x => x.Product(item.Product.Id, item.Product.UrlName)) %>" 
        title="Go to <%= Html.Encode(item.Product.Name) %> Details Page">
        <%= Html.Image("~/Content/ProductImages/" + item.Product.DefaultImage.Thumbnail) %>
    </a></td>
        <td><%= Html.TextBox("ProductId" + item.Product.Id, item.Quantity)%></td>
        <td><a href="<%= Html.BuildUrlFromExpression<CatalogController>(x => x.Product(item.Product.Id, item.Product.UrlName)) %>" 
            title="Go to <%= Html.Encode(item.Product.Name) %> Details Page"><%= Html.Encode(item.Product.Name)%></a></td>
        <td><%= item.Product.Price.ToString("C")%></td>
        <td><%= item.SubTotal.ToString("C")%></td>
        <td><%= Html.ActionLink<CartController>(x => x.Remove(item.Product.Id), "Remove")%></td>
       </tr>
    <% } %>
    <tr>
        <td></td>
        <td><%= Html.SubmitButton("Update", "Update Quantity") %></td>
        <td></td>
        <td>Subtotal:</td>
        <td><%= ViewData.Model.SubTotal.ToString("C") %></td>
        <td></td>
    </tr>
    <% } %>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td>Shipping</td>
        <td><%= ViewData.Model.ShippingAndHandling.ToString("C") %></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td>Total</td>
        <td><%= ViewData.Model.Total.ToString("C") %></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <%= Html.GoogleCheckout(ViewData.Model) %>
        </td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <%= Html.PaypalCheckout(ViewData.Model) %>
        </td>
        <td></td>
    </tr>
    </table>
    
    
    
</asp:Content>
